package com.smartwebx.ha.web.gis.module.screen;

import static com.smartwebx.ha.web.admin.common.HaConstant.HA_USER_SESSION_KEY;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;

import com.smartwebx.ha.biz.assign.HaAreaManager;
import com.smartwebx.ha.dal.usebean.GisAreaInfo;
import com.smartwebx.ha.web.admin.common.HaUserSys;

public class GisInfoScreen extends BasicScreen {

	@Autowired
	private HaAreaManager haAreaService;
	@Autowired
	private HttpServletRequest request;

	public GisAreaInfo getGisInfo() {
		return haAreaService.getGisAreaInfoByAreaId(getAreaId());
	}

	protected int getAreaId() {
		HttpSession session = request.getSession();
		HaUserSys haUserSys = (HaUserSys) session
				.getAttribute(HA_USER_SESSION_KEY);
		Integer areaId = haUserSys.getAreaId();
		return areaId;
	}
}